1. Field of the Invention
This invention relates to a method and an apparatus for supervising data of a non-volatile memory, the storage area of which is divided into a plurality of blocks, the non-volatile memory, a storage device having the non-volatile memory, and a data processing system.
This application claims priority of Japanese Patent Application No. 2003-354281, filed on Oct. 14, 2003, the entirety of which is incorporated by reference herein.
2. Description of Related Art
As typical of an external storage device used in a data processing apparatus, such as a personal computer or a digital still camera, there is an external storage device provided with a flash memory.
With the external storage device, provided with the flash memory, the storage area is divided into plural blocks, and the data area is supervised on the block basis. Each block is the unit of data erasure. That is, in erasing data, the block including the data in its entirety is initialized, so that the data stored in the block is erased in a lump.
If, in such external storage device, the data is stored in a block, a unique logical address is accorded to each such block, which is supervised using this logical block.
The data stored in the external storage device is usually stored on the file basis in the external storage device. If a sole file is stored across plural blocks, the link information for these blocks is needed. Thus, if the sole file is stored in the plural blocks, the logical address of the next block, termed the link address, is stored in each of the blocks, having the file stored therein.
Up to now, in this sort of the external storage device, the processing for inspecting whether or not there is any error in the storage area or the processing for concealing errors that have occurred is carried out each time the external storage device is booted. In the following explanation, this processing is termed the error detection and correction processing. Usually, the error detection and correction processing is the time-consuming processing involving a relatively large load. Hence, the conventional external storage device suffers from a drawback that it cannot be booted quickly by reason of the error detection and correction processing.
It is supposed that, in the external storage device, in which the data area is supervised on the block basis, the data is newly written, or the data stored in the block is updated, and that, in such case, the power supply is suddenly interrupted or the external storage device is forcibly dismounted from the data processing device. In this case, such states may arise in which plural blocks having the same logical address may coexist or in which there is no block indicated by the link address. These states are referred to below as the state of the logical address error or the state of the link address error, respectively. In such case, the external storage device cannot be used as regularly, with the file being incidentally linked to an unexpected block.
However, the conventional external storage device does not have the function of detecting logical errors or link errors to conceal the errors properly. The result is that, if the power supply is suddenly interrupted or the external storage device is forcibly dismounted from the data processing device, the external storage device is no longer usable regularly as from such time.
[patent publication 1]
Japanese Laid-Open Patent Publication H8-227372